package at.jku.se.fastsell.db4o.transactions;

import java.util.LinkedList;
import java.util.List;

import com.db4o.ObjectSet;

import at.jku.se.fastsell.data.Auction;
import at.jku.se.fastsell.db4o.DatabaseException;

public class GetAllAuctionsTransaction extends Transaction<List<Auction>> {

	@Override
	public List<Auction> run() throws DatabaseException {
		List<Auction> auctions = new LinkedList<Auction>();
		
		ObjectSet<Auction> result = db.queryByExample(Auction.class);
		auctions.addAll(result);
		
		return auctions;		
	}

}
